package cn.edu.scau.cmi.zhuyuxian.compositePattern.safe;
import java.util.ArrayList;
import java.util.Iterator;
public class OrganizationComposite extends OrganizationComponent {

private ArrayList<OrganizationComponent> children;
    
    public OrganizationComposite(String name) {
    	super(name);
    	children = new ArrayList<>();
    }
    public void add(OrganizationComponent chilld) {
    	this.children.add(chilld);
    }
    
    public void remove(OrganizationComponent chilld) {
    	if(children != null) {
    		this.children.remove(chilld);
    	}
    }
	@Override
	public String detail() {
		
		return this.name;	
	}
    public ArrayList<OrganizationComponent> getChildren(){
    	return children;
    }

}
